USE [RD_FixedAssetsMart]
GO
/****** Object:  StoredProcedure [dbo].[USP_AssetMaster_Refresh]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_AssetMaster_Refresh]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE  PROCEDURE [dbo].[USP_AssetMaster_Refresh]
AS
-------------------------------------------------------------------------------
--	Author:			Andrews Consulting Group 
--	Created:			04/01/2004
--	Description:		Updates RD_FixedAssetsMart Assest MAster			
--
--	Application:		FA AMrt
--
--
--Modification History
--
--Date			Modified By		Description
--01.21.2004 					SP created
-------------------------------------------------------------------------------
-------------------------------------------------------------------
----UPDATE  ParentUnitorTagNumeber from FA_Star_AssetMaster
-------------------------------------------------------------------
	UPDATE RD_FixedAssetsMart.dbo.FA_Star_AssetMaster
		Set ParentUnitorTagNumber = ISNULL((Select  UnitorTagNumber FROM RD_FixedAssetsMart.dbo.FA_Star_AssetMaster UPD 
						WHERE UPD.AssetItemNumber = AM.ParentNumber and 
								UPD.Sourceid =SourceID),ParentUnitorTagNumber)
	From 	RD_FixedAssetsMart.dbo.FA_Star_AssetMaster AM


/* end of stored procedure */
' 
END
GO
/****** Object:  StoredProcedure [dbo].[USP_Load_Orphans_FA]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_Load_Orphans_FA]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--	Author:			c Copyright 2004 Andrews Consulting Group 
--	Procedure:		USP_LOAD_ORPHANS_AP
--
--	Description:	User Stored Procedure To Populate the table
--					storing orphans.
--						
--
--	Application:	Load Orphans table
--
--
--Modification History
--Date				Modified By			Description
--08.18.2006		Craig Scott			Created.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

CREATE     PROCEDURE [dbo].[USP_Load_Orphans_FA] @DateRun DATETIME
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- Clear the table of any previous records for this mart
	-- then load it again for a one time run.
	--DELETE FROM RD_COMMON.DBO.ORPHANS WHERE vchMart = ''FAMART''

	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'', @DateRun, ''Account'',T1.ACCOUNT, COUNT(T1.Account)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_FixedAssetsMart.DBO.FA_Star_Account T2
    ON T1.Account = T2.Account and
	T1.Sourceid = T2.SourceId
    WHERE T2.SourceId is null
	GROUP BY T1.Account

	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'',@DateRun,''AssetItemNumber'',T1.AssetItemNumber,COUNT(T1.AssetItemNumber)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_FixedAssetsMart.DBO.FA_Star_AssetMaster T2
    ON   T1.AssetItemNumber = T2.AssetItemNumber
	and T1.Sourceid = T2.SourceId
    WHERE T2.AssetItemNumber is null
	GROUP BY T1.AssetItemNumber

	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'', @DateRun, ''BusinessUnitCode'', T1.BusinessUnitCode,COUNT(T1.BusinessUnitCode)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_Common.dbo.Star_BusinessUnit T2 ON
 	T1.BusinessUnitCode = T2.BusinessUnitCode and
	T2.SOURCEID = T1.SOURCEID
	WHERE T2.BusinessUnitCode IS NULL
	GROUP BY T1.BusinessUnitCode

	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'',@DateRun,''CompanyNumber'',T1.CompanyNumber,COUNT(T1.CompanyNumber)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_Common.dbo.Star_Company  T2 ON
 	T1.CompanyNumber = T2.CompanyNumber 
	AND T2.SOURCEID = T1.SOURCEID
	WHERE T2.CompanyNumber IS NULL
	GROUP BY T1.CompanyNumber
	
	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'',@DateRun,''Depreciation FormulaID'',T1.FormulaID,COUNT(T1.FormulaID)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_FixedAssetsMart.DBO.FA_Star_Depreciation_Formulas T2
    ON T1.FormulaID = T2.FormulaID and
	T1.Sourceid = T2.SourceId 
    WHERE T2.SourceId is null
	GROUP BY T1.FormulaID

	INSERT RD_COMMON.DBO.ORPHANS
	SELECT DISTINCT ''FAMART'',@DateRun,''Date Depreciation Started'',T1.DateDepreciationStartedID,COUNT(T1.DateDepreciationStartedID)
	FROM RD_FixedAssetsMart.DBO.FA_Star_Facts T1
    LEFT JOIN RD_FixedAssetsMart.dbo.FA_Star_Dates T2
    ON T1.DateDepreciationStartedID = T2.CompanyDateID 
    WHERE T2.CompanyDateID is null 
	GROUP BY T1.DateDepreciationStartedID



END
' 
END
GO
/****** Object:  Table [dbo].[FA_Star_Annual_Depreciation_Rules]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Annual_Depreciation_Rules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_Annual_Depreciation_Rules](
	[AnnualDepreciationRuleID] [char](30) NOT NULL,
	[SourceID] [int] NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateFrom] [datetime] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[AssetLifeYearStart] [int] NOT NULL,
	[PlacedInServicePeriod] [int] NOT NULL,
	[SecondaryContinuation] [char](1) NOT NULL,
	[AssetLifeYearThrough] [int] NOT NULL,
	[AnnualMultiplier] [decimal](20, 7) NOT NULL,
	[DepreciationFormula] [char](3) NOT NULL,
	[BasisFormula] [char](3) NOT NULL,
	[SalvageFormula] [char](3) NOT NULL,
	[UpperLimitFormula] [char](3) NOT NULL,
	[LowerLimitFormula] [char](3) NOT NULL,
	[SpreadPatternReference] [char](3) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_Annual_Depreciation_Rules] PRIMARY KEY CLUSTERED 
(
	[DepreciationMethod] ASC,
	[LifeMonths] ASC,
	[ComputationMethodITDorRem] ASC,
	[DepreciationInformation] ASC,
	[DateFrom] ASC,
	[StartEffectiveDate] ASC,
	[AssetLifeYearStart] ASC,
	[PlacedInServicePeriod] ASC,
	[SecondaryContinuation] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_AssetMaster]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_AssetMaster](
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitorTagNumber] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[ParentUnitorTagNumber] [char](12) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[MajorAccountingClass] [char](3) NOT NULL,
	[MajorEquipmentClass] [char](3) NOT NULL,
	[Manufacturer] [char](3) NOT NULL,
	[ModelYear] [char](3) NOT NULL,
	[UsageMilesorHours] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[Description03] [char](30) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[DateAcquired] [datetime] NOT NULL,
	[DateDisposedorRetired] [datetime] NOT NULL,
	[EquipmentStatus] [char](2) NOT NULL,
	[NeworUsedonAcquisition] [char](1) NOT NULL,
	[AmountEstimatedSalvageValue] [decimal](20, 7) NOT NULL,
	[AmountReplacementCost] [decimal](20, 7) NOT NULL,
	[AmountLastYearsReplacementCost] [decimal](20, 7) NOT NULL,
	[AssetCostAccountBusinessUnit] [char](12) NOT NULL,
	[AssetCostAccountObject] [char](6) NOT NULL,
	[AssetCostAccountSubsidiary] [char](8) NOT NULL,
	[AccumulatedDeprecAccountBU] [char](12) NOT NULL,
	[AccumulatedDeprecAccountObjct] [char](6) NOT NULL,
	[AccumulatedDeprecAccountSub] [char](8) NOT NULL,
	[DepreciationExpenseBU] [char](12) NOT NULL,
	[DepreciationExpenseObject] [char](6) NOT NULL,
	[DepreciationExpenseSubsidiary] [char](8) NOT NULL,
	[AssetRevenueBusinessUnit] [char](12) NOT NULL,
	[AssetRevenueObject] [char](6) NOT NULL,
	[AssetRevenueSubsidiary] [char](8) NOT NULL,
	[AssetItemCurrentQuantity] [decimal](20, 7) NOT NULL,
	[AssetItemOriginalQuantity] [decimal](20, 7) NOT NULL,
	[TaxEntity] [int] NOT NULL,
	[AmountInvestmentTaxCredit] [decimal](20, 7) NOT NULL,
	[AmountInvestmentTaxCreditPYE] [decimal](20, 7) NOT NULL,
	[FinancingMethod] [char](1) NOT NULL,
	[ITCOwnedYN] [char](1) NOT NULL,
	[PurchaseOption] [char](1) NOT NULL,
	[AmountPurchaseOptionPrice] [decimal](20, 7) NOT NULL,
	[PurchaseOptionCreditPercentage] [decimal](20, 7) NOT NULL,
	[AmountPurchaseOptionMaxCredit] [decimal](20, 7) NOT NULL,
	[AddressNumberLessorRentorMort] [int] NOT NULL,
	[DateContractDate] [datetime] NOT NULL,
	[DateExpiredJulian] [datetime] NOT NULL,
	[AmountMonthlyPayment] [decimal](20, 7) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[NameRemark] [char](30) NOT NULL,
	[InsurancePolicyNumber] [char](25) NOT NULL,
	[InsuranceCompany] [char](25) NOT NULL,
	[PolicyRenewalMonth] [int] NOT NULL,
	[AmountInsurancePremium] [decimal](20, 7) NOT NULL,
	[AmountInsuranceValue] [decimal](20, 7) NOT NULL,
	[InsuranceValueIndexfutureuse] [decimal](20, 7) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[BusinessUnitLocation] [char](12) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateExpectedReturn] [datetime] NOT NULL,
	[MessageClearedYN] [char](1) NOT NULL,
	[NameExplanation] [char](30) NOT NULL,
	[RemarkExplaination] [char](30) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [varchar](255) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [varchar](255) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [varchar](255) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [varchar](255) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [varchar](255) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [varchar](255) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [varchar](255) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [varchar](255) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [varchar](255) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [varchar](255) NOT NULL,
	[StandardFuelConsumption] [decimal](20, 7) NOT NULL,
	[DisposalAccumulatedDeprecBU] [char](12) NOT NULL,
	[DisposalAccumulatedDeprecObj] [char](6) NOT NULL,
	[DisposalAccumulatedDeprecSub] [char](8) NOT NULL,
	[UnitNumber] [char](8) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[ItemNumber2ndKit] [char](25) NOT NULL,
	[AFENumber] [char](12) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[DateUpdatedID] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [varchar](255) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [varchar](255) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [varchar](255) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [varchar](255) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [varchar](255) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [varchar](255) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [varchar](255) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [varchar](255) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [varchar](255) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [varchar](255) NOT NULL,
	[Category21Code] [char](10) NOT NULL,
	[Category21] [varchar](255) NOT NULL,
	[Category22Code] [char](10) NOT NULL,
	[Category22] [varchar](255) NOT NULL,
	[Category23Code] [char](10) NOT NULL,
	[Category23] [varchar](255) NOT NULL,
	[AllowWorkOrderYN] [char](1) NOT NULL,
	[Criticality] [int] NOT NULL,
	[WarrantyFlag] [char](1) NOT NULL,
	[DateWarrantyExpirationJulian] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_AssetMaster] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_Depreciation_Formulas]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Depreciation_Formulas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_Depreciation_Formulas](
	[FormulaIDID] [char](10) NOT NULL,
	[FormulaID] [char](30) NOT NULL,
	[SourceID] [int] NOT NULL,
	[Description] [char](20) NOT NULL,
	[DescriptionCompressed20Long] [char](20) NOT NULL,
	[ColumnHeading1] [char](11) NOT NULL,
	[ColumnHeading02] [char](11) NOT NULL,
	[FormulaInquiryColumn] [char](40) NOT NULL,
	[DecimalPositions] [int] NOT NULL,
	[EditCode] [char](1) NOT NULL,
	[DepreciationFormulaAmount] [decimal](20, 7) NOT NULL,
	[DataItemGlossary] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[EditDisable] [char](1) NOT NULL,
	[Source] [char](20) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL
) ON [PRIMARY]
WITH
(
DATA_COMPRESSION = PAGE
)
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_Depreciation_Period_Spread_Rules]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Depreciation_Period_Spread_Rules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_Depreciation_Period_Spread_Rules](
	[SpreadRuleID] [char](30) NOT NULL,
	[SourceID] [int] NOT NULL,
	[SpreadPatternReference] [char](3) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[PercentagePeriod01] [decimal](20, 7) NOT NULL,
	[PercentagePeriod02] [decimal](20, 7) NOT NULL,
	[PercentagePeriod03] [decimal](20, 7) NOT NULL,
	[PercentagePeriod04] [decimal](20, 7) NOT NULL,
	[PercentagePeriod05] [decimal](20, 7) NOT NULL,
	[PercentagePeriod06] [decimal](20, 7) NOT NULL,
	[PercentagePeriod07] [decimal](20, 7) NOT NULL,
	[PercentagePeriod08] [decimal](20, 7) NOT NULL,
	[PercentagePeriod09] [decimal](20, 7) NOT NULL,
	[PercentagePeriod10] [decimal](20, 7) NOT NULL,
	[PercentagePeriod11] [decimal](20, 7) NOT NULL,
	[PercentagePeriod12] [decimal](20, 7) NOT NULL,
	[PercentagePeriod13] [decimal](20, 7) NOT NULL,
	[PercentagePeriod14] [decimal](20, 7) NOT NULL,
	[Source] [char](20) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_Depreciation_Period_Spread_Rules] PRIMARY KEY CLUSTERED 
(
	[SpreadPatternReference] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_Depreciation_Rules]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Depreciation_Rules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_Depreciation_Rules](
	[DepreciationRuleID] [char](15) NOT NULL,
	[SourceID] [int] NOT NULL,
	[Description] [char](30) NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateFrom] [datetime] NOT NULL,
	[DateThru] [datetime] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[DepreciationBusinessUnit] [char](1) NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[FirstYearSpreadConvention] [char](1) NOT NULL,
	[LifeYearReferenceConvention] [char](1) NOT NULL,
	[LastYearSpreadConvention] [char](1) NOT NULL,
	[DisposalConvention] [char](1) NOT NULL,
	[OverUnderAllowed] [char](1) NOT NULL,
	[NegativeAllowed] [char](1) NOT NULL,
	[SecondaryAcctConvention] [char](1) NOT NULL,
	[DepreciationCalculationFlag] [char](1) NOT NULL,
	[EditDisable] [char](1) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_Depreciation_Rules] PRIMARY KEY CLUSTERED 
(
	[DepreciationMethod] ASC,
	[LifeMonths] ASC,
	[DepreciationInformation] ASC,
	[ComputationMethodITDorRem] ASC,
	[DateFrom] ASC,
	[StartEffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_EquipmentMasterExtension]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentMasterExtension]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_EquipmentMasterExtension](
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[CountryCode] [char](3) NOT NULL,
	[CompanyOwned] [char](1) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[DateOrderedJulian] [datetime] NOT NULL,
	[DateShippedJulian] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[SalespersonCode01] [int] NOT NULL,
	[AddNumOwnerBilling] [int] NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[DateCompletion] [datetime] NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[OriginalLineNumber] [decimal](20, 7) NOT NULL,
	[ProductFamily] [char](8) NOT NULL,
	[ProductModel] [char](8) NOT NULL,
	[ProductComponent] [char](10) NOT NULL,
	[ConfiguredModel] [char](25) NOT NULL,
	[SystemCodeEncryptedMatri] [char](36) NOT NULL,
	[VehicleIdentNum] [char](30) NOT NULL,
	[ReferenceNumber] [char](30) NOT NULL,
	[Category01Code] [char](10) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](10) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](10) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](10) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](10) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](10) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](10) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](10) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](10) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](10) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[CreatedByUser] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[Location] [char](20) NOT NULL,
	[WorkOrderNumber] [int] NOT NULL,
	[BillRevisionLevel] [char](3) NOT NULL,
	[EffectiveFromDate] [datetime] NOT NULL,
	[DefaultDealer] [int] NOT NULL,
	[AssessorNumber] [int] NOT NULL,
	[TermsAcceptedFlag] [char](1) NOT NULL,
	[SalesType] [char](3) NOT NULL,
	[InServiceDate] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[MeterReadingRequired] [char](1) NOT NULL,
	[RegistrationStatus] [char](3) NOT NULL,
	[CompCodeGrpSys] [char](2) NOT NULL,
	[CompCodeAssembly] [char](8) NOT NULL,
	[Manufacturer] [char](10) NOT NULL,
	[Distributor] [int] NOT NULL,
	[EquipmentPartsNumber] [int] NOT NULL,
	[AllowMeterSchedules] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_EquipmentMasterExtension] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_EquipmentMessages]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentMessages]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_EquipmentMessages](
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[ExplanationFull] [varchar](1200) NOT NULL,
	[DateMessages] [datetime] NOT NULL,
	[DateCentury] [int] NOT NULL,
	[TimeOfDay] [decimal](20, 7) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[AmtMilesOrHoursUnit] [decimal](20, 7) NOT NULL,
	[EquipmentMessageType] [char](1) NOT NULL,
	[ItemMessageStatus] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[AmtSchedulePrimaryUm] [decimal](20, 7) NOT NULL,
	[AmtScheduleSecondUm] [decimal](20, 7) NOT NULL,
	[AmountScheduleDays] [decimal](20, 7) NOT NULL,
	[AmtActLastServMiHr] [decimal](20, 7) NOT NULL,
	[AmtActLastServPriUm] [decimal](20, 7) NOT NULL,
	[AmtActLastServSecUm] [decimal](20, 7) NOT NULL,
	[AmtActLastServDays] [decimal](20, 7) NOT NULL,
	[CalcuMethodMilesHrs] [char](1) NOT NULL,
	[CalculaMethodPriUm] [char](1) NOT NULL,
	[CalculaMethodSecondUm] [char](1) NOT NULL,
	[CalculationMethodDays] [char](1) NOT NULL,
	[DateJulian] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_EquipmentMessages] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[TimeOfDay] ASC,
	[DateJulian] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_EquipmentPMScheduleModel]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentPMScheduleModel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_EquipmentPMScheduleModel](
	[ServiceTypeID] [char](50) NOT NULL,
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkOrderNoAssigned] [int] NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[CompletedHours] [decimal](20, 7) NOT NULL,
	[ConsumedFuel] [decimal](20, 7) NOT NULL,
	[CompletedMilesHours] [decimal](20, 7) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastCompletedDate] [datetime] NOT NULL,
	[LastHours] [decimal](20, 7) NOT NULL,
	[LastFuelConsumed] [decimal](20, 7) NOT NULL,
	[LastMilesHours] [decimal](20, 7) NOT NULL,
	[MaintPercentComplete] [int] NOT NULL,
	[MaintenancePriority] [char](1) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[MaintenanceStatus] [char](2) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[ServiceDays] [int] NOT NULL,
	[ServiceHours] [decimal](20, 7) NOT NULL,
	[ServiceFuel] [decimal](20, 7) NOT NULL,
	[ServiceMilesHours] [decimal](20, 7) NOT NULL,
	[WeekNumber] [int] NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[ToleranceLimitUpper] [decimal](20, 7) NOT NULL,
	[ToleranceLimitLower] [decimal](20, 7) NOT NULL,
	[WeeksSpecific] [decimal](20, 7) NOT NULL,
	[MonthsSpecific] [decimal](20, 7) NOT NULL,
	[HoursSpecific] [decimal](20, 7) NOT NULL,
	[SpecificDayOfTheWeek] [char](1) NOT NULL,
	[DatePlannedToStart] [datetime] NOT NULL,
	[PMCategory02Code] [char](3) NOT NULL,
	[PMCategory02] [char](30) NOT NULL,
	[PMCategory01Code] [char](3) NOT NULL,
	[PMCategory01] [char](30) NOT NULL,
	[AlertLevel] [char](1) NOT NULL,
	[OriginalMiles] [decimal](20, 7) NOT NULL,
	[OriginalHours] [decimal](20, 7) NOT NULL,
	[OriginalFuel] [decimal](20, 7) NOT NULL,
	[Occurences] [decimal](20, 7) NOT NULL,
	[MultipleWO] [char](1) NOT NULL,
	[DateHold] [datetime] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[DowntimeRequired] [decimal](20, 7) NOT NULL,
	[Criticality] [int] NOT NULL,
	[FrequencyIndicator] [char](1) NOT NULL,
	[CompletedDate] [datetime] NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[AddNoAssignedTo] [int] NOT NULL,
	[ScheduleType] [char](1) NOT NULL,
	[ServiceMeter4] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter4] [decimal](20, 7) NOT NULL,
	[CompletedMeter4] [decimal](20, 7) NOT NULL,
	[OriginalMeter4] [decimal](20, 7) NOT NULL,
	[ServiceMeter5] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter5] [decimal](20, 7) NOT NULL,
	[CompletedMeter5] [decimal](20, 7) NOT NULL,
	[OriginalMeter5] [decimal](20, 7) NOT NULL,
	[ServiceMeter6] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter6] [decimal](20, 7) NOT NULL,
	[CompletedMeter6] [decimal](20, 7) NOT NULL,
	[OriginalMeter6] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_EquipmentPMScheduleModel] PRIMARY KEY CLUSTERED 
(
	[ServiceType] ASC,
	[Category10Code] ASC,
	[Category01Code] ASC,
	[Category02Code] ASC,
	[Category03Code] ASC,
	[Category04Code] ASC,
	[Category05Code] ASC,
	[Category06Code] ASC,
	[Category07Code] ASC,
	[Category08Code] ASC,
	[Category09Code] ASC,
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_Facts]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_Facts](
	[AIDID] [bigint] NOT NULL,
	[AccountID] [char](20) NOT NULL,
	[AssetItemNumberID] [bigint] NOT NULL,
	[BusinessUnitID] [char](20) NOT NULL,
	[CompanyNumberID] [bigint] NOT NULL,
	[AnnualDepreciationRuleID] [char](30) NOT NULL,
	[FormulaID] [char](30) NOT NULL,
	[SpreadRuleID] [char](30) NOT NULL,
	[DepreciationRuleID] [char](30) NOT NULL,
	[FiscalYearID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[Century] [int] NOT NULL,
	[Account] [char](15) NOT NULL,
	[AID] [char](8) NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[FiscalQuarter] [char](4) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[PriorYearCloseBalance] [decimal](20, 7) NOT NULL,
	[NetPosting01] [decimal](20, 7) NOT NULL,
	[NetPosting02] [decimal](20, 7) NOT NULL,
	[NetPosting03] [decimal](20, 7) NOT NULL,
	[NetPosting04] [decimal](20, 7) NOT NULL,
	[NetPosting05] [decimal](20, 7) NOT NULL,
	[NetPosting06] [decimal](20, 7) NOT NULL,
	[NetPosting07] [decimal](20, 7) NOT NULL,
	[NetPosting08] [decimal](20, 7) NOT NULL,
	[NetPosting09] [decimal](20, 7) NOT NULL,
	[NetPosting10] [decimal](20, 7) NOT NULL,
	[NetPosting11] [decimal](20, 7) NOT NULL,
	[NetPosting12] [decimal](20, 7) NOT NULL,
	[NetPosting13] [decimal](20, 7) NOT NULL,
	[NetPosting14] [decimal](20, 7) NOT NULL,
	[Balance01] [decimal](20, 7) NOT NULL,
	[Balance02] [decimal](20, 7) NOT NULL,
	[Balance03] [decimal](20, 7) NOT NULL,
	[Balance04] [decimal](20, 7) NOT NULL,
	[Balance05] [decimal](20, 7) NOT NULL,
	[Balance06] [decimal](20, 7) NOT NULL,
	[Balance07] [decimal](20, 7) NOT NULL,
	[Balance08] [decimal](20, 7) NOT NULL,
	[Balance09] [decimal](20, 7) NOT NULL,
	[Balance10] [decimal](20, 7) NOT NULL,
	[Balance11] [decimal](20, 7) NOT NULL,
	[Balance12] [decimal](20, 7) NOT NULL,
	[Balance13] [decimal](20, 7) NOT NULL,
	[Balance14] [decimal](20, 7) NOT NULL,
	[PriorYearEndNetPosting] [decimal](20, 7) NOT NULL,
	[WeekToDateNetPosting] [decimal](20, 7) NOT NULL,
	[OriginalBeginningBudget] [decimal](20, 7) NOT NULL,
	[MemoBudgetChange] [decimal](20, 7) NOT NULL,
	[PercentComplete] [decimal](20, 7) NOT NULL,
	[MemoCommitmentChanges] [decimal](20, 7) NOT NULL,
	[RequestedBudget] [decimal](20, 7) NOT NULL,
	[ApprovedBudget] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[MethodPercent] [int] NOT NULL,
	[ScheduleNoMethod9] [char](12) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateDepreciationStartedID] [bigint] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AssetAccountType] [char](1) NOT NULL,
	[DepreciationCalculationFlag] [char](1) NOT NULL,
	[CostBalanceCrossReference] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_Facts] PRIMARY KEY CLUSTERED 
(
	[AID] ASC,
	[Century] ASC,
	[FiscalYear] ASC,
	[FiscalQuarter] ASC,
	[AssetItemNumber] ASC,
	[SubLedger] ASC,
	[SubledgerType] ASC,
	[LedgerTypeCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_LicenseMaster]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_LicenseMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_LicenseMaster](
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LicenseNumber] [char](8) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[AddressNumberLicensingAgency] [int] NOT NULL,
	[DateLicenseLastIssued] [datetime] NOT NULL,
	[AmountLicenseFee] [decimal](20, 7) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateLicenseRenewalJulian] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_LicenseMaster] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[StateCode] ASC,
	[LicenseNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_LocationTracking]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_LocationTracking]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_LocationTracking](
	[AssetItemNumberID] [bigint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LocationHistOrSched] [char](1) NOT NULL,
	[CostCenterLocation] [char](12) NOT NULL,
	[DateEnding] [datetime] NOT NULL,
	[Remark] [char](30) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[TransferNumber] [char](12) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[Quantity] [decimal](20, 7) NOT NULL,
	[EquipmentStatus] [char](2) NOT NULL,
	[NextNumberValue] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[TimeStampBeginning] [int] NOT NULL,
	[TimeStampEnding] [int] NOT NULL,
	[MeterOriginalReading] [decimal](20, 7) NOT NULL,
	[MeterCurrentReading] [decimal](20, 7) NOT NULL,
	[EquipmentRateTable] [char](3) NOT NULL,
	[EquipmentRateGroup] [char](3) NOT NULL,
	[AmountActualBilled] [decimal](20, 7) NOT NULL,
	[Aisle] [char](8) NOT NULL,
	[Bin] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[TransferActionCode] [char](1) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_LocationTracking] PRIMARY KEY CLUSTERED 
(
	[NextNumberValue] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[FA_Star_MaintenanceScheduleFacts]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_MaintenanceScheduleFacts]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FA_Star_MaintenanceScheduleFacts](
	[ServiceTypeID] [char](50) NOT NULL,
	[AssetItemNumberID] [bigint] NOT NULL,
	[BusinessUnitID] [varchar](20) NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[MaintenanceStatus] [char](2) NOT NULL,
	[MaintenancePriority] [char](1) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[AddNoAssignedTo] [int] NOT NULL,
	[Remark] [char](30) NOT NULL,
	[ServiceDays] [int] NOT NULL,
	[ServiceMilesHours] [decimal](20, 7) NOT NULL,
	[ServiceFuel] [decimal](20, 7) NOT NULL,
	[DateScheduledTicklerID] [bigint] NOT NULL,
	[CompletedMilesHours] [decimal](20, 7) NOT NULL,
	[ConsumedFuel] [decimal](20, 7) NOT NULL,
	[CompletedDateID] [bigint] NOT NULL,
	[LastMilesHours] [decimal](20, 7) NOT NULL,
	[LastFuelConsumed] [decimal](20, 7) NOT NULL,
	[LastCompletedDateID] [bigint] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdatedID] [bigint] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[WorkOrderNoAssigned] [int] NOT NULL,
	[MaintPercentComplete] [int] NOT NULL,
	[ServiceHours] [decimal](20, 7) NOT NULL,
	[CompletedHours] [decimal](20, 7) NOT NULL,
	[LastHours] [decimal](20, 7) NOT NULL,
	[MultipleWO] [char](1) NOT NULL,
	[OriginalMiles] [decimal](20, 7) NOT NULL,
	[OriginalHours] [decimal](20, 7) NOT NULL,
	[OriginalFuel] [decimal](20, 7) NOT NULL,
	[Occurences] [decimal](20, 7) NOT NULL,
	[FrequencyIndicator] [char](1) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[Criticality] [int] NOT NULL,
	[DatePlannedToStartID] [bigint] NOT NULL,
	[PMCategory01Code] [char](3) NOT NULL,
	[PMCategory01] [char](30) NOT NULL,
	[PMCategory02Code] [char](3) NOT NULL,
	[PMCategory02] [char](30) NOT NULL,
	[DowntimeRequired] [decimal](20, 7) NOT NULL,
	[AlertLevel] [char](1) NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[ToleranceLimitUpper] [decimal](20, 7) NOT NULL,
	[ToleranceLimitLower] [decimal](20, 7) NOT NULL,
	[DateHoldID] [bigint] NOT NULL,
	[HoursSpecific] [decimal](20, 7) NOT NULL,
	[WeeksSpecific] [decimal](20, 7) NOT NULL,
	[MonthsSpecific] [decimal](20, 7) NOT NULL,
	[WeekNumber] [int] NOT NULL,
	[SpecificDayOfTheWeek] [char](1) NOT NULL,
	[ScheduleType] [char](1) NOT NULL,
	[ServiceMeter4] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter4] [decimal](20, 7) NOT NULL,
	[CompletedMeter4] [decimal](20, 7) NOT NULL,
	[OriginalMeter4] [decimal](20, 7) NOT NULL,
	[ServiceMeter5] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter5] [decimal](20, 7) NOT NULL,
	[CompletedMeter5] [decimal](20, 7) NOT NULL,
	[OriginalMeter5] [decimal](20, 7) NOT NULL,
	[ServiceMeter6] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter6] [decimal](20, 7) NOT NULL,
	[CompletedMeter6] [decimal](20, 7) NOT NULL,
	[OriginalMeter6] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FA_Star_MaintenanceScheduleFacts] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[JDECSInstalledBaseLocationHist]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDECSInstalledBaseLocationHist]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDECSInstalledBaseLocationHist](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[TypeOfRec] [char](1) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[AddressNumberLessor] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CostCenterLocation] [char](12) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LocationHistOrSched] [char](1) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[TimeStampBeginning] [int] NOT NULL,
	[DateEnding] [datetime] NOT NULL,
	[TimeStampEnding] [int] NOT NULL,
	[TransferNumber] [char](12) NOT NULL,
	[TransferActionCode] [char](1) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDECSInstalledBaseLocationHist] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  View [dbo].[FA_Star_Account]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Account]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[FA_Star_Account]
AS
SELECT     *
FROM         RD_Common.dbo.Star_Account

' 
GO
/****** Object:  View [dbo].[FA_Star_Account_Model]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Account_Model]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[FA_Star_Account_Model]
AS
SELECT     *
FROM         RD_Common.dbo.Star_Account_Model

' 
GO
/****** Object:  View [dbo].[FA_Star_BusinessUnit]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_BusinessUnit]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[FA_Star_BusinessUnit]
AS
SELECT     *
FROM         RD_Common.dbo.Star_BusinessUnit

' 
GO
/****** Object:  View [dbo].[FA_Star_BusinessUnitSecurity]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_BusinessUnitSecurity]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[FA_Star_BusinessUnitSecurity]
AS
SELECT     *
FROM         RD_CommonWork.dbo.JDEBOBusinessUnitSecurity
' 
GO
/****** Object:  View [dbo].[FA_Star_Company]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Company]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[FA_Star_Company]
AS
SELECT     *
FROM         RD_Common.dbo.Star_Company

' 
GO
/****** Object:  View [dbo].[FA_Star_Dates]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Dates]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[FA_Star_Dates]
AS
SELECT     *
FROM         RD_Common.dbo.Star_Dates
' 
GO
/****** Object:  View [dbo].[FA_Star_FiscalYear]    Script Date: 5/30/13 1:03:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_FiscalYear]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[FA_Star_FiscalYear]
AS
SELECT     *
FROM         RD_Common.dbo.Star_FiscalYear

' 
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Annual_Depreciation_Rule_AnnualDepreciationRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Annual_Depreciation_Rules]') AND name = N'IX_Annual_Depreciation_Rule_AnnualDepreciationRuleID')
CREATE NONCLUSTERED INDEX [IX_Annual_Depreciation_Rule_AnnualDepreciationRuleID] ON [dbo].[FA_Star_Annual_Depreciation_Rules]
(
	[AnnualDepreciationRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_AssetMaster_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'IX_AssetMaster_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_AssetMaster_AssetItemNumberID] ON [dbo].[FA_Star_AssetMaster]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_AssetMaster_ParentNumber]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'IX_AssetMaster_ParentNumber')
CREATE NONCLUSTERED INDEX [IX_AssetMaster_ParentNumber] ON [dbo].[FA_Star_AssetMaster]
(
	[ParentNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_271]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'missing_index_271')
CREATE NONCLUSTERED INDEX [missing_index_271] ON [dbo].[FA_Star_AssetMaster]
(
	[AddressNumberLessorRentorMort] ASC
)
INCLUDE ( 	[UnitorTagNumber],
	[SerialNumber],
	[Description01],
	[Description03]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_273]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'missing_index_273')
CREATE NONCLUSTERED INDEX [missing_index_273] ON [dbo].[FA_Star_AssetMaster]
(
	[AddressNumberLessorRentorMort] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_40]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'missing_index_40')
CREATE NONCLUSTERED INDEX [missing_index_40] ON [dbo].[FA_Star_AssetMaster]
(
	[SerialNumber] ASC,
	[EquipmentStatus] ASC,
	[Category08Code] ASC
)
INCLUDE ( 	[BusinessUnitCode],
	[Description03],
	[AddressNumberLessorRentorMort]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_592]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_AssetMaster]') AND name = N'missing_index_592')
CREATE NONCLUSTERED INDEX [missing_index_592] ON [dbo].[FA_Star_AssetMaster]
(
	[AddressNumberLessorRentorMort] ASC
)
INCLUDE ( 	[UnitorTagNumber],
	[SerialNumber],
	[Description01],
	[Description03],
	[StartEffectiveDate]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Depreciation_Period_Spread_Rules_SpreadRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Depreciation_Period_Spread_Rules]') AND name = N'IX_Depreciation_Period_Spread_Rules_SpreadRuleID')
CREATE NONCLUSTERED INDEX [IX_Depreciation_Period_Spread_Rules_SpreadRuleID] ON [dbo].[FA_Star_Depreciation_Period_Spread_Rules]
(
	[SpreadRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Depreciation_Rules_DepreciationRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Depreciation_Rules]') AND name = N'IX_Depreciation_Rules_DepreciationRuleID')
CREATE NONCLUSTERED INDEX [IX_Depreciation_Rules_DepreciationRuleID] ON [dbo].[FA_Star_Depreciation_Rules]
(
	[DepreciationRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_EquipmentMasterExtension_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentMasterExtension]') AND name = N'IX_EquipmentMasterExtension_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_EquipmentMasterExtension_AssetItemNumberID] ON [dbo].[FA_Star_EquipmentMasterExtension]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_EquipmentMessages_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentMessages]') AND name = N'IX_EquipmentMessages_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_EquipmentMessages_AssetItemNumberID] ON [dbo].[FA_Star_EquipmentMessages]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_EquipmentPMScheduleModel_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_EquipmentPMScheduleModel]') AND name = N'IX_EquipmentPMScheduleModel_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_EquipmentPMScheduleModel_AssetItemNumberID] ON [dbo].[FA_Star_EquipmentPMScheduleModel]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_Account]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_Account')
CREATE NONCLUSTERED INDEX [IX_Facts_Account] ON [dbo].[FA_Star_Facts]
(
	[AccountID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_AccountID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AccountID')
CREATE NONCLUSTERED INDEX [IX_Facts_AccountID] ON [dbo].[FA_Star_Facts]
(
	[AccountID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_AIDID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AIDID')
CREATE NONCLUSTERED INDEX [IX_Facts_AIDID] ON [dbo].[FA_Star_Facts]
(
	[AIDID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_AnnDepRule]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AnnDepRule')
CREATE NONCLUSTERED INDEX [IX_Facts_AnnDepRule] ON [dbo].[FA_Star_Facts]
(
	[AnnualDepreciationRuleID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_AnnualDepreciationRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AnnualDepreciationRuleID')
CREATE NONCLUSTERED INDEX [IX_Facts_AnnualDepreciationRuleID] ON [dbo].[FA_Star_Facts]
(
	[AnnualDepreciationRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_AssetItemNumber]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AssetItemNumber')
CREATE NONCLUSTERED INDEX [IX_Facts_AssetItemNumber] ON [dbo].[FA_Star_Facts]
(
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_Facts_AssetItemNumberID] ON [dbo].[FA_Star_Facts]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_BusinessUnitCode]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_BusinessUnitCode')
CREATE NONCLUSTERED INDEX [IX_Facts_BusinessUnitCode] ON [dbo].[FA_Star_Facts]
(
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_BusinessUnitID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_BusinessUnitID')
CREATE NONCLUSTERED INDEX [IX_Facts_BusinessUnitID] ON [dbo].[FA_Star_Facts]
(
	[BusinessUnitID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_CompanyID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_CompanyID')
CREATE NONCLUSTERED INDEX [IX_Facts_CompanyID] ON [dbo].[FA_Star_Facts]
(
	[CompanyNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_CompanyNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_CompanyNumberID')
CREATE NONCLUSTERED INDEX [IX_Facts_CompanyNumberID] ON [dbo].[FA_Star_Facts]
(
	[CompanyNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_DateDepreStarted]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_DateDepreStarted')
CREATE NONCLUSTERED INDEX [IX_Facts_DateDepreStarted] ON [dbo].[FA_Star_Facts]
(
	[DateDepreciationStartedID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_DepreciationRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_DepreciationRuleID')
CREATE NONCLUSTERED INDEX [IX_Facts_DepreciationRuleID] ON [dbo].[FA_Star_Facts]
(
	[DepreciationRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_DepreciationRules]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_DepreciationRules')
CREATE NONCLUSTERED INDEX [IX_Facts_DepreciationRules] ON [dbo].[FA_Star_Facts]
(
	[DepreciationMethod] ASC,
	[LifeMonths] ASC,
	[DepreciationInformation] ASC,
	[ComputationMethodITDorRem] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_FiscalYear]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_FiscalYear')
CREATE NONCLUSTERED INDEX [IX_Facts_FiscalYear] ON [dbo].[FA_Star_Facts]
(
	[FiscalYear] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_Facts_FiscalYearID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_FiscalYearID')
CREATE NONCLUSTERED INDEX [IX_Facts_FiscalYearID] ON [dbo].[FA_Star_Facts]
(
	[FiscalYearID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_FormulaID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_FormulaID')
CREATE NONCLUSTERED INDEX [IX_Facts_FormulaID] ON [dbo].[FA_Star_Facts]
(
	[FormulaID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_SpreadRule]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_SpreadRule')
CREATE NONCLUSTERED INDEX [IX_Facts_SpreadRule] ON [dbo].[FA_Star_Facts]
(
	[SpreadRuleID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_Facts_SpreadRuleID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'IX_Facts_SpreadRuleID')
CREATE NONCLUSTERED INDEX [IX_Facts_SpreadRuleID] ON [dbo].[FA_Star_Facts]
(
	[SpreadRuleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_167]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'missing_index_167')
CREATE NONCLUSTERED INDEX [missing_index_167] ON [dbo].[FA_Star_Facts]
(
	[LedgerTypeCode] ASC,
	[ObjectAccount] ASC
)
INCLUDE ( 	[FiscalYearID],
	[PriorYearCloseBalance],
	[NetPosting01],
	[NetPosting02],
	[NetPosting03],
	[NetPosting04],
	[NetPosting05],
	[NetPosting06],
	[NetPosting07],
	[NetPosting08],
	[NetPosting09],
	[NetPosting10]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_169]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'missing_index_169')
CREATE NONCLUSTERED INDEX [missing_index_169] ON [dbo].[FA_Star_Facts]
(
	[AssetAccountType] ASC
)
INCLUDE ( 	[AssetItemNumberID],
	[PriorYearCloseBalance]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_179]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'missing_index_179')
CREATE NONCLUSTERED INDEX [missing_index_179] ON [dbo].[FA_Star_Facts]
(
	[LedgerTypeCode] ASC,
	[ObjectAccount] ASC
)
INCLUDE ( 	[FiscalYearID],
	[PriorYearCloseBalance],
	[NetPosting01],
	[NetPosting02],
	[NetPosting03],
	[NetPosting04],
	[NetPosting05],
	[NetPosting06],
	[NetPosting07]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_203]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'missing_index_203')
CREATE NONCLUSTERED INDEX [missing_index_203] ON [dbo].[FA_Star_Facts]
(
	[BusinessUnitID] ASC,
	[LedgerTypeCode] ASC
)
INCLUDE ( 	[AIDID],
	[AssetItemNumberID],
	[FiscalYearID],
	[PriorYearCloseBalance],
	[NetPosting01],
	[NetPosting02],
	[NetPosting03],
	[NetPosting04],
	[NetPosting05],
	[NetPosting06],
	[NetPosting07],
	[NetPosting08],
	[NetPosting09],
	[NetPosting10],
	[ObjectAccount],
	[Subsidiary]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_206]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_Facts]') AND name = N'missing_index_206')
CREATE NONCLUSTERED INDEX [missing_index_206] ON [dbo].[FA_Star_Facts]
(
	[BusinessUnitID] ASC,
	[LedgerTypeCode] ASC,
	[ObjectAccount] ASC
)
INCLUDE ( 	[AssetItemNumberID],
	[FiscalYearID],
	[PriorYearCloseBalance],
	[NetPosting01],
	[NetPosting02],
	[NetPosting03],
	[NetPosting04],
	[NetPosting05],
	[NetPosting06],
	[NetPosting07],
	[NetPosting08],
	[NetPosting09],
	[NetPosting10]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_LicenseMaster_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_LicenseMaster]') AND name = N'IX_LicenseMaster_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_LicenseMaster_AssetItemNumberID] ON [dbo].[FA_Star_LicenseMaster]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_LocationTracking_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_LocationTracking]') AND name = N'IX_LocationTracking_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_LocationTracking_AssetItemNumberID] ON [dbo].[FA_Star_LocationTracking]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_MaintenanceScheduleFacts_AssetItemNumberID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_MaintenanceScheduleFacts]') AND name = N'IX_MaintenanceScheduleFacts_AssetItemNumberID')
CREATE NONCLUSTERED INDEX [IX_MaintenanceScheduleFacts_AssetItemNumberID] ON [dbo].[FA_Star_MaintenanceScheduleFacts]
(
	[AssetItemNumberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_MaintenanceScheduleFacts_BusinessUnitID]    Script Date: 5/30/13 1:03:47 PM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[FA_Star_MaintenanceScheduleFacts]') AND name = N'IX_MaintenanceScheduleFacts_BusinessUnitID')
CREATE NONCLUSTERED INDEX [IX_MaintenanceScheduleFacts_BusinessUnitID] ON [dbo].[FA_Star_MaintenanceScheduleFacts]
(
	[BusinessUnitID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
\